package com.aplink.generic.google.maps.clustering.view;

import java.util.Set;

import com.aplink.generic.google.maps.clustering.Cluster;
import com.aplink.generic.google.maps.clustering.ClusterItem;
import com.aplink.generic.google.maps.clustering.ClusterManager;

/**
 * Renders clusters.
 */
public interface ClusterRenderer<T extends ClusterItem> {

	/**
	 * Called when the view is added.
	 */
	void onAdd();

	/**
	 * Called when the view needs to be updated because new clusters need to be
	 * displayed.
	 *
	 * @param clusters
	 *            the clusters to be displayed.
	 */
	void onClustersChanged(Set<? extends Cluster<T>> clusters);

	/**
	 * Called when the view is removed.
	 */
	void onRemove();

	void setOnClusterClickListener(
			ClusterManager.OnClusterClickListener<T> listener);

	void setOnClusterInfoWindowClickListener(
			ClusterManager.OnClusterInfoWindowClickListener<T> listener);

	void setOnClusterItemClickListener(
			ClusterManager.OnClusterItemClickListener<T> listener);

	void setOnClusterItemInfoWindowClickListener(
			ClusterManager.OnClusterItemInfoWindowClickListener<T> listener);
}
